home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / UTILFILE / PUFF.LZH / PUFF.DOC < prev    next >
Text File  |  1988-06-16  |  49KB  |  963 lines

  1.  ********************************************************************
  2.  * Documentation for PUFF V3.05 - Dave Mitchell April 1988          *
  3.  ********************************************************************
  4.  
  5.    PUFF is a directory and file browser which pops up on demand.  It
  6. takes up between 29 and 42K of memory when resident (depending on
  7. installation options).  It runs under DOS 2 or 3 on any model PC and
  8. will work on both Mono and Color adapters.  Once installed you pop it
  9. up at any time by pressing the hot-key which by default is Alt-D.
  10. This gives you the ability to browse directories and both ASCII and
  11. non-ASCII files within other programs such as word processors, spread-
  12. sheets, debuggers or even at the DOS prompt.  It's intended to be very
  13. easy to use and contains several screens of on-line help accessible
  14. via the F1 key so you shouldn't need to read this document to use it!
  15.   PUFF makes it possible to do things like:
  16.    - browse the source of a program while debugging it
  17.    - check the name of a file in a directory before loading it into
  18.      a spread-sheet
  19.    - quickly move up and down a directory tree looking for a file
  20.    - check when you last saved a particular file
  21.    - copy part or all of one file into an editor or word processor
  22.    - see how much room there is on a diskette before saving a file
  23.    - erase, copy or rename files at any time
  24.  
  25.   There are three reasons why PUFF may not be able to pop up when
  26. you want it to:
  27.  
  28.    - the application that's currently running is not asking for a
  29.      keystroke.  PUFF won't pop up in long-running "batch" programs
  30.      like compiles or assemblies.
  31.    - the current display is in a graphics mode.  PUFF can only pop up
  32.      in text modes.
  33.    - at the time you ask PUFF to pop up, DOS is busy.  PUFF checks
  34.      to make sure that nothing dangerous (such as file I/O) is going
  35.      on when you ask it to pop up.
  36.  
  37.    Despite all my efforts, PUFF is still not entirely "crash-proof".
  38. See the section on  THINGS TO AVOID  for more details.
  39.  
  40.     SUMMARY OF CHANGES
  41.   PUFF Version 3 is a major rewrite of PUFF.  Many new features
  42. have been added and a few have been dropped.  Here's a summary:
  43.  
  44.      General Changes:
  45.     - support for larger screens (43-line etc)
  46.     - some support for enhanced keyboard (although PUFF doesn't know
  47.       names such as F11, F12 etc, they can be set as the hot-key)
  48.     - better bw80 support (treated as Mono not Color)
  49.     - all PUFFSET customising functions now included
  50.     - the directory/file buffer is now 6 or 12K
  51.     - the PUFF box can be quickly moved to screen corners using Home,
  52.       End PgUp and PgDn keys
  53.     - when pasting, line feeds can be ignored or pasted
  54.     - the normal cursor is suppressed when PUFF is popped up
  55.     - PUFF now always pops up on the current DOS screen (can't force
  56.       Mono anymore)
  57.     - PUFF no longer supports 40-column screens
  58.  
  59.      In Directory Browse:
  60.     - new popup menu of commands via "?"
  61.     - attributes can be shown (instead of size)
  62.     - date/time are properly country-dependent
  63.     - sorting is almost twice as fast
  64.     - original DOS order can be restored
  65.     - new commands allow copy, erase and rename of files (and rename
  66.       of directories and moving of files)
  67.     - can now switch directly to another directory via 'N' command
  68.     - customise options menus available directly via 'O' command
  69.  
  70.    A number of commands have had to change "name":
  71.       D  does Directory Refresh (was R for Refresh) since R is Rename
  72.       T  forces TEXT mode file browse (was A for ASCII) since A now
  73.          toggles Attribute/size display
  74.  
  75.      In File Browse:
  76.     - new popup menu of commands via "?"
  77.     - can now switch directly to another file via 'N' command
  78.     - customise options menus available directly via 'O' command
  79.     - browsing is almost twice as fast
  80.     - searching is almost twice as fast
  81.     - search string can always be entered in hex or text
  82.     - search can be case sensitive or not as required
  83.     - in text mode, the cursor moves as in a normal editor
  84.  
  85.    A number of commands have had to change "name":
  86.       T  goes from HEX to Text mode (used to be A for ASCII)
  87.       A  switches to ASCII rather than EBCDIC when in HEX mode (was
  88.          T for Translate) since T goes to Text mode
  89.       R  does repeat search (was N for Next) since N goes to New file
  90.  
  91.     INSTALLING PUFF
  92.   When invoked, PUFF looks for its profile in the current and root
  93. directories of the current drive.  The profile, a file called PUFF.PRO,
  94. can be created or tailored using PUFF itself (see the section
  95. "Customising PUFF").  Use SUBST, EXT, SRCHDIR or a similar program if
  96. you want to put it somewhere else.  If PUFF can't find its profile it
  97. uses default values.
  98.  
  99.   The PUFF command looks like this:
  100.         PUFF [hotkey] [initvu] [/n][/e][/s][/b][/l][/q][/x][/h]
  101.    or
  102.         PUFF ?
  103.  
  104.   The second form will give you a brief description of PUFF and the
  105. syntax of the first form.
  106.   All the parameters in the first form of the command are optional.
  107. The first, the hot-key, is Alt-D by default but PUFF will accept:
  108.  
  109.    a-x        where x is any letter a-z   (26 Alt keys)
  110.    c-x        where x is any letter a-z   (26 Ctrl-keys)
  111.    fn         where n is any number 1-10  (10 Function keys)
  112.    a-fn       where n is any number 1-10  (10 Alt-Function keys)
  113.    c-fn       where n is any number 1-10  (10 Ctrl-Function keys)
  114.    s-fn       where n is any number 1-10  (10 Shift-Function keys)
  115.  
  116.   The default hot-key can be changed by creating a new PUFF profile.
  117. See the section  "CUSTOMISING PUFF"   for details.  Function keys F1
  118. and F2 have special uses inside PUFF so they should not be used as
  119. hot-keys.
  120.   The second parameter, initvu, lets you specify the name of a file
  121. which PUFF will display on first popping up (rather than displaying
  122. the main menu).  Note PUFF will treat anything it doesn't recognize
  123. as a hot-key as an  initvu  specification.  If your  initvu  option
  124. could be mistaken for a hot key (e.g. "F2") then you MUST specify
  125. the hot-key too.  If the name matches a set of files (e.g. it
  126. contains an asterisk), then PUFF will popup in directory browse.
  127.   The /r option lets you  `remove'  a copy of PUFF that is already
  128. resident.  This can be useful in BAT files that invoke programs
  129. incompatible with PUFF, as a way of ensuring that PUFF is not present.
  130.   If you attempt to install PUFF when it already resident PUFF will
  131. not re-install itself but will tell you what the hot-key of the
  132. already installed version is.
  133.   The /n (Normal) option restricts PUFF to the top 25 lines of the
  134. screen.  This reduces memory requirements by about 4K.
  135.   The /e (EGA) option allows PUFF to use up to 50 screen lines (on an
  136. EGA, VGA or MCGA), but increases memory requirements by about 4K.
  137.   The /s (Small) option forces PUFF to use only 6K of buffer space,
  138. reducing its memory requirements at the cost of performance.
  139.   The /b (Big) option makes PUFF use 12K of buffer space, by doubling
  140. the sizes of PUFF's directory and file buffers.  This allows PUFF to
  141. handle directories with up to 555 files.  If there are less than 275
  142. files then PUFF does not have to re-read the directory when returning
  143. from a file browse, improving performance considerably.  The extra
  144. file buffer makes scrolling through a file faster too, since the file
  145. is read in 4k rather than 2k chunks.
  146.   The /l (Loud) option makes PUFF install itself `noisily', producing
  147. a banner which gives its version number and buffer sizes.
  148.   The /q (Quiet) option makes PUFF install itself `quietly', without
  149. any banner or messages.
  150.   The /x (eXclude) option excludes the installation of on-line help.
  151. This makes PUFF take up less storage (about 3K less at present but
  152. this might increase if more help is added) but means that inside PUFF
  153. only a single screen of help is available.
  154.   The /h option (Help) includes the on-line help.
  155.   PUFF.COM is about 23K in size but takes up 29-42K when installed.
  156.  
  157.     PUFF'S MAIN MENU
  158.   When you press the hot-key PUFF will test to see if it's safe to pop
  159. up. It won't pop up if DOS is doing something that it would be
  160. dangerous to interrupt.  If you try to pop up when the screen is in a
  161. graphics mode, PUFF will beep instead (earlier versions looked for a
  162. Mon screen in this case).
  163.   When popped up, the main PUFF menu offers the following options:
  164.    .Browse Current Directory
  165.    .Select Directory for Browsing
  166.    .Customise (set options)
  167.    .Write new profile (save options)
  168.    .Quit (pop-down)
  169.    .Remove PUFF from Memory
  170.  
  171.   The current directory is shown at the bottom of the menu.  One of
  172. the options will be high-lighted.  The cursor up and down keys move
  173. this bar and the Enter or Cursor Right keys select the high-lighted
  174. option.  You can also select an option by typing the first letter on
  175. the line (B for Browse, R for Remove and so on).
  176.   F1 will usually give context-sensitive help (unless the /x option
  177. has been used).
  178.   PUFF treats the Esc key as a general "cancel" or "quit" key.  PUFF
  179. will also let you  `exit immediately' by pressing the hot-key rather
  180. than Esc.  You can do this at any time (except when help is being
  181. displayed or input being requested).
  182.   If you leave PUFF this way you will return to where you left off
  183. when you pop up PUFF again.
  184.   Most of the time PUFF responds to the F2 key by copying the active
  185. screen to the alternate display - if you've got one!  This allows you
  186. to save the PUFF screen on the other display and then consult the
  187. data it contains when you return to the original application.  Note
  188. that the attributes are  `not' copied since some color attributes can
  189. cause unpleasant blinking on a Mono display.
  190.  
  191.     BROWSE CURRENT DIRECTORY
  192.   This option will cause PUFF to display the current directory.  On
  193. entry to PUFF this will be the current directory on the current drive
  194. (unless PUFF has been customised - see "CUSTOMISING PUFF" below).
  195.   Twelve lines are shown, with the current line at the centre.  Each
  196. line shows the filename, size and date/time stamp.  Sub-directories
  197. are indicated by <DIR>.  Instead of filesize, PUFF can display the
  198. file attributes.
  199.   The order in which the files are initially displayed is by default
  200. the same order as a DOS DIR command would display, but you can make
  201. it by name, extension, date or size by forcing PUFF to do a sort
  202. before it displays the list.  See the section on "CUSTOMISING PUFF"
  203. for details.
  204.   PUFF displays file dates in either MM/DD/YY (US) format, DD/MM/YY
  205. (European) format or in YY/MM/DD format (Japanese etc). and times in
  206. 12- or 24-hour clock style, depending on the COUNTRY code setting in
  207. CONFIG.SYS, just as the DOS DIR command does.
  208.   In directory browse PUFF responds to keys as follows:
  209.    ?              pops up a command menu
  210.    A  (Attribute) toggle between display of attributes or file size
  211.    C  (Copy)      copies current file
  212.    D  (Display)   refresh directory buffer (eg after erase/rename/copy)
  213.    E  (Erase)     erases current file
  214.    F  (Free)      display free space available on drive
  215.    H  (HEX)       as Right, but forces display to HEX mode
  216.    M  (Move)      moves current file
  217.    N  (New)       allow switch to new directory directly
  218.    O  (Options)   access the options menus
  219.    P  (Paste)     paste a file name or its contents into
  220.                   the current application
  221.    Q  (Quit)      quit (return to Main Menu)
  222.    R  (Rename)    renames current file
  223.    S  (Sort)      sort current directory by Name, Extension,
  224.                   Size, Date or back to DOS order
  225.    T  (Text)      as Right, but forces display to text mode
  226.  
  227.    Up             move up 1 line (towards start of directory)
  228.    Down           move down 1 line
  229.    PgUp           move up 11 lines
  230.    PgDn           move down 11 lines
  231.    Ctrl-Home      move to first entry
  232.    Ctrl-End       move to last entry
  233.    Left           browse parent directory (if any)
  234.    Right          browse selected sub-directory or file
  235.    Enter          same as Right
  236.    +              switch to next drive (eg from A: to B:)
  237.    -              switch to previous drive (eg from B: to A:)
  238.  
  239.    Esc            return to Main Menu
  240.    F1             give help about directory browse mode
  241.    F2             copy active screen to other display
  242.  
  243.   Some of these commands demand a bit more explanation.
  244.  
  245.     THE ? COMMAND
  246.   Because it's easy to forget just what letter keys PUFF responds to,
  247. the new "?" command pops up a command menu.  You can then select a
  248. command by moving the hilighting bar, or by typing its first letter.
  249. The cursor Up, Down, PgUp, PgDn, Home and End keys all move the bar.
  250. The bottom line of the menu shows an up and/or down arrow if more
  251. unseen options lie above the first line or below the last line seen.
  252.   As well as selecting an item, you can pop-down the menu by
  253. pressing Esc.
  254.  
  255.     COPY, ERASE, MOVE and RENAME
  256.   Erase will ask you if you are sure before doing the erase and all
  257. four commands can be cancelled by pressing Esc.  If you erase, move
  258. or rename files, PUFF leaves the entries in the display, but replaces
  259. the filesize field with the word <ERASED>, <MOVED> or <RENAMED>.  When
  260. marked like this a file or directory cannot be browsed, renamed or
  261. copied.  The 'D' command will properly refresh the display.
  262.   Note that you can `move' files to another directory and rename
  263. `directories' as well as files (you can't erase or move directories
  264. though, and PUFF does not support RemoveDir).
  265.   When copying, moving or renaming be careful.  If the new name does
  266. not begin with a drive specifier or backslash PUFF will prefix the
  267. name you give with the current PUFF directory (which may not be the
  268. same as the current DOS directory).
  269.   When moving or renaming the new name may just be a drive letter
  270. followed by a colon or a path ending with a backslash.  In these
  271. cases, PUFF will use the old filename.extension for the target file.
  272.  
  273.     THE DISPLAY COMMAND
  274.   The Display command causes PUFF to re-read the directory.  This is
  275. useful when you have changed diskettes while PUFF is popped up, or if
  276. you have popped down using the hot-key and then created, modified or
  277. erased some files so that when you pop up again the directory will not
  278. be up to date.  Pressing D will cause the directory to be re-read.
  279.  
  280.     THE FREE COMMAND
  281.   The free space display, which was automatic in earlier versions of
  282. PUFF, is now produced using the F command.  This change was made
  283. because computing free space can take quite a while, particularly on
  284. a fixed disk with a lot of directories and files.
  285.  
  286.     THE NEW COMMAND
  287.   This option lets you switch to another directory directly rather
  288. than having to use the cursor left and right keys to traverse the
  289. directory tree.
  290.  
  291.     THE OPTIONS COMMAND
  292.   This lets you access the two customizing menus from within directory
  293. browsing.  This makes it quicker to move the PUFF box around, change
  294. the hot-key or screen colours since PUFF no longer has to re-read the
  295. directory when you go back.
  296.  
  297.     THE PASTE COMMAND
  298.   The Paste command causes PUFF to pop-down and then "paste" key-
  299. strokes into the application program that was running when PUFF was
  300. popped up.  You can paste the name (i.e. filename.ext), the full name
  301. (i.e.  drive:\path\filename.ext) or the contents of the file (see the
  302. section on the "PUFF FILE BROWSER" for how to paste just part of the
  303. contents of a file).  The keystrokes will appear where the cursor was,
  304. just as if you had typed them in.
  305.   When you pop PUFF up again you will go back to the directory
  306. display, as though you had popped down using the hot-key.
  307.   Pasting the contents of a file can be used as a sort of BAT or input
  308. redirection facility or to copy one file into another in an editor
  309. that does not support paths.
  310.   In general PUFF treats each byte in the file as a separate keystroke.
  311. It stops at Ctrl-Z and treats a X'00' byte as a signal that the
  312. following byte is an Extended ASCII code.  Thus the sequence X'003B'
  313. would cause PUFF to send back the code for function key F1 (whose scan
  314. code is 59 = X'3B').  For a list of the codes associated with the
  315. cursor keys, Alt-keys and various function/shift combinations see the
  316. BASIC Manual (Appendix D) or the Technical Reference Manual.
  317.   Some editors treat a carriage return as a signal to go to the start
  318. of the current line and require a different key to be pressed to
  319. `insert' a blank line.  PUFF can be made, through its profile, to
  320. return some other keystroke instead of the carriage return (X'0D') to
  321. force a new line to be inserted and can filter out Line Feeds if
  322. needed.  Thus you can make PUFF treat a carriage return as an F9
  323. (which inserts a line in PE) or F2 (which does the same in KEDIT). For
  324. more details, see the section on `CUSTOMIZING PUFF'.
  325.   Note that to paste into most editors you must also make sure the
  326. cursor is in the data area rather than on the command line (unless the
  327. keystroke file includes something like an Esc to switch the cursor
  328. over).
  329.   During pasting PUFF responds to the following keys:
  330.       space bar       - pause until another key is pressed
  331.       +               - speed up pasting
  332.       -               - slow down pasting
  333.       any other key   - terminate pasting and return to normal
  334.                         keyboard input
  335.  
  336.     THE SORT COMMAND
  337.   Sorting is done in alphabetical order for Name, and in reverse order
  338. for Size (big files first) and Date (newest files first).  Sorting by
  339. extension actually sorts by name within extension.  The current sort
  340. order is displayed on the `Browsing Directory' line.  Note that PUFF
  341. now lets you go back to the original DOS order after sorting if you
  342. want.
  343.  
  344.     OTHER COMMANDS
  345.   The Left and Right keys also deserve a bit more explanation. If PUFF
  346. was popped up when the current DOS directory is C:\TOOLS then this is
  347. the directory that PUFF will display.  Pressing the Left cursor key
  348. will cause PUFF to display the root directory while pressing Right or
  349. Enter when the current high-lighted line is a subdirectory called
  350. EDITORS will cause PUFF to display the C:\TOOLS\EDITORS directory.  If
  351. the current line is a file then PUFF will display that (see "PUFF FILE
  352. BROWSER" later).
  353.   PUFF tries to be intelligent about these keys.  If you move right
  354. and then left again, you should get back to the line you came from in
  355. the higher directory (eg the EDITORS line) even if the directory has
  356. been sorted or files have been copied, erased or moved.  If you start
  357. in a sub-directory and move left then PUFF should be bright enough to
  358. find the right line.
  359.   The + and - keys also try to be intelligent.  On a single floppy
  360. system, such as an XT, the A and B logical drives are mapped onto a
  361. single physical drive.  Any reference to B when the current drive is A
  362. will cause DOS to display a message "Insert diskette for drive B".
  363. PUFF tries to avoid this by skipping over the logical drive which is
  364. not current.  Thus + will skip from A to C and - from C to A if the
  365. current drive is A.  If the current drive is B then - will not try to
  366. skip to A.
  367.   One final point.  PUFF has only a small 6K buffer (12K with /B
  368. option) so it can only store up to about 275 (or 555) directory
  369. entries.  If the directory has more entries only the first 275 (or
  370. 555) will be shown.  PUFF will display a message if there are too many
  371. files to display all of them.  This message will only appear the first
  372. time you browse a given directory, but the 275 (or 555) will always be
  373. followed by a "+" if there are more files.  You can use the "Select
  374. Directory for Browsing" option to select a subset of files  from a
  375. large directory.
  376.  
  377.     PUFF FILE BROWSER
  378.   From directory browsing you can select a file for viewing by
  379. pressing Cursor Right, Enter, T or H.  For PUFF a text file is one
  380. which has a Carriage Return/Line Feed at the end of each record and a
  381. Ctrl-Z at the end of the file.  The file browser operates in one of
  382. two modes:
  383.   Text   in this mode each line on the screen shows a file line. Long
  384.          lines are truncated but PUFF allows sideways scrolling so
  385.          that long lines can be viewed.  The screen tells you which
  386.          file line and column the cursor is at.
  387.          This is the default mode for text files and is forced if you
  388.          use the T command.
  389.   HEX    in this mode the screen is divided up into three vertical
  390.          parts. On the left is the offset from the start of the file
  391.          (in Hex), in the middle are 8 bytes of data in Hex while on
  392.          the right are the same 8 bytes in ASCII (or in EBCDIC if
  393.          EBCDIC translation is turned on).  In Zoom mode there are 16
  394.          bytes of data on each line.
  395.          This is the default mode for non-text files and is forced if
  396.          you use the H command.
  397.   If you enter the file browser using Enter or Cursor Right, PUFF
  398. guesses what sort of file is being browsed using an extremely simple
  399. algorithm.  If the last byte of the file is Ctrl-Z or Line Feed it
  400. assumes the file is text and goes into text mode, if not it uses HEX
  401. mode.  Alternatively you can force the mode by using T or H.
  402.  
  403.     TEXT MODE COMMANDS
  404.   The following commands are available in ASCII mode:
  405.  
  406.   ?            pops up a command menu
  407.   E (Expand)   expand/compress tab characters
  408.                (tabs at every 8th column)
  409.   G (Goto)     go to line n
  410.   H (Hex)      switch to HEX mode
  411.   N (New)      allow switch to new file directly
  412.   O (Options)  access the options menus
  413.   P (Paste)    paste file contents
  414.   Q (Quit)     quit (return to directory browser)
  415.   R (Repeat)   repeat search for string
  416.   S (Search)   search for a text string
  417.   Z (Zoom)     switch to Zoom mode or back
  418.   '            search for a hex string
  419.   /            search for a text string
  420.  
  421.   Up           move cursor up 1 line (towards start of the file)
  422.   Down         move cursor down 1 line
  423.   PgUp         move up a screenful
  424.   PgDn         move down a screenful
  425.   Ctrl-PgUp    move up 100 lines
  426.   Ctrl-PgDn    move down 100 lines
  427.   Ctrl-Home    move to first line
  428.   Ctrl-End     move to last line
  429.  
  430.   Left         move cursor left 1 column
  431.   Right        move cursor right 1 column
  432.   Tab          move cursor right 10 columns
  433.   BackTab      move cursor left 10 columns
  434.   Ctrl-Right   move cursor right a screen width
  435.   Ctrl-Left    move cursor left a screen width
  436.   Home         move cursor to column 1
  437.   End          move cursor to end of line
  438.  
  439.   Esc          return to directory browsing
  440.   F1           give help about ASCII file browse mode
  441.   F2           copy active screen to other display
  442.  
  443.   As with the directory browser, the new   ?   command pops up a
  444. command menu.
  445.   One new feature of text mode is that the current position is shown
  446. by a normal blinking cursor which is moved by the cursor keys (just
  447. as in most editors).  Earlier versions of PUFF always made the current
  448. position the top left of the window, which made searching and
  449. scrolling unfriendly to say the least!
  450.  
  451.     HEX MODE COMMANDS
  452.   The following commands are available in HEX mode:
  453.  
  454.   ?            pops up a command menu
  455.   A (ASCII)    switch to ASCII
  456.   E (EBCDIC)   switch to EBCDIC
  457.   N (New)      allow switch to new file directly
  458.   O (Options)  access the options menus
  459.   P (Paste)    paste file contents
  460.   Q (Quit)     quit (return to directory browser)
  461.   R (Repeat)   repeat search for string
  462.   S (Search)   search for a HEX string
  463.   L (Low)      toggle Low Hex display on and off
  464.   T (Text)     switch to text mode
  465.   Z (Zoom)     switch to Zoom mode or back
  466.   '            search for a hex string
  467.   /            search for a text string
  468.  
  469.   Up           move up 8/16 bytes (towards start of the file)
  470.   Down         move down 8/16 bytes
  471.   PgUp         move up a screenful
  472.   PgDn         move down a screenful
  473.   Ctrl-PgUp    move up 1024 bytes
  474.   Ctrl-PgDn    move down 1024 bytes
  475.   Ctrl-Home    move to first byte
  476.   Ctrl-End     move to end of file
  477.   Left         move up 1 byte
  478.   Right        move down 1 byte
  479.  
  480.   Esc          return to directory browsing
  481.   F1           give help about HEX file browse mode
  482.   F2           copy active screen to other display
  483.  
  484.   As with the directory browser, the new  ?  command pops up a command
  485. menu.
  486.   Note that PUFF tries to keep a count of the current file line in all
  487. modes.  So if you switch from ASCII into HEX mode, scroll about and
  488. then return to text mode the line number should be correct.  However
  489. if you jump directly to the end of the file (using Ctrl-End) PUFF will
  490. not know the line number unless you have previously scrolled there. In
  491. such a case the line number will show as ????.
  492.   The current version of PUFF can be confused by attempting to display
  493. non-ASCII files in ASCII mode, particularly if the resulting lines
  494. appear to be more than 255 bytes long.
  495.   The maximum size file you can browse is about 100 Megabytes!
  496.   The Low Hex translate option lets you suppress the display of
  497. characters with ASCII codes below X'20'.  These characters cause
  498. problems if you try to print the screen since they are treated by
  499. printers as control characters (form feed, line feed etc).
  500.   EBCDIC translate lets you view a file, in the right-hand column, in
  501. EBCDIC form.  Thus X'F1F2F3' will appear as the string '123'.  This
  502. option can be useful when viewing Displaywrite files which are stored
  503. in EBCDIC form.  PUFF displays the state of the toggle on the
  504. "Browsing HEX file" line.
  505.  
  506.     PASTING WITHIN FILE BROWSE
  507.   When browsing a file you can make PUFF paste the file contents using
  508. the 'P' command.  PUFF will then ask if you want to paste just the
  509. current line, the rest of the file or to go back to the start and
  510. paste the whole file.  Note that in the first two cases pasting starts
  511. at the cursor position (rather than the beginning of the current line).
  512.  
  513.     SEARCHING IN PUFF
  514.   The Search command lets you search for an ASCII or HEX string.  The
  515. 'S' command expects a text string in text mode and a hex string
  516. (pairs of hex digits optionally separated by blanks) in hex mode.  The
  517. / expects a text string (and can be useful in HE mode) while the '
  518. command expects hex digits (and can be useful in text mode).  The
  519. search starts at the current position in the file and you can
  520. terminate the search at any time by pressing any key. See the section
  521. Data Entry in PUFF  for details of how the search string may be
  522. edited.
  523.   Depending on the option setting searching can be case-insensitive or
  524. not. In the former case a search for "The" will stop at "the" or "THE"
  525. as well.  Accented characters above X'7F' are also treated in this
  526. way, using the standard DOS rules for equivalence (so the upper and
  527. lower case c cedilla - x'80' and x'87' are treated as equivalent).
  528.   The Repeat command will find the next occurrence of the string.  In
  529. text mode, it starts on the current line, at the byte after the
  530. current column.  In HEX mode, it starts at the byte after the current
  531. position which is essentially the same.
  532.   Note that you can enter a search string in one mode (eg text) and
  533. then use Repeat in the other mode and PUFF will still search for the
  534. same string.
  535.  
  536.     ZOOM MODE
  537.   The Z command switches between the normal PUFF browser and full-
  538. screen mode.  In full-screen mode PUFF responds to the same set of
  539. commands but obviously displays more of the file at once - 25 or more
  540. lines of 80 columns.  In ZOOM mode, the PgUp and PgDn keys are
  541. adjusted so that they still scroll a pageful (i.e. for PgDn what was
  542. the bottom line becomes the top).  The Ctrl-Left and Ctrl-Right keys
  543. in text mode are similarly adjusted.
  544.  
  545.     SELECT DIRECTORY FOR BROWSING
  546.   This lets you select any directory for browsing. PUFF will accept
  547. most combinations of drive, path and filespec information, so the
  548. following are all valid:
  549.         C:\               all files in root directory on C
  550.         C:                all files in current directory on C
  551.         C:\*.COM          all COM files in root directory on C
  552.         C:\TOOLS\         all files in TOOLS subdirectory on C
  553.         C:\TOOLS          ditto
  554.         TOOLS\            displays all files in TOOLS subdirectory
  555.                           of current directory on current drive.
  556.         TOOLS             ditto
  557.         TO*.*             all files/sub-directories beginning with
  558.                           TO in current directory on current drive
  559.  
  560.   If the selected drive/directory has no files PUFF will beep and
  561. display a message.
  562.   Entering a blank line will cause the current directory to be reset
  563. to the value it had on entry to PUFF.  You can cancel this option by
  564. pressing Esc.
  565.   See the section "DATA ENTRY IN PUFF" for details of how a filespec
  566. may be edited.
  567.  
  568.     CUSTOMIZE (SET OPTIONS)
  569.   The choices on this menu are described in detail in the section
  570. "CUSTOMIZING PUFF".
  571.  
  572.     WRITE A NEW PROFILE (SAVE OPTIONS)
  573.   This causes PUFF to write a new profile, using the current value of
  574. all options.  Thus once you have set these to the values you like and
  575. created a new profile, the next time you install PUFF the options
  576. will all get the appropriate values.
  577.  
  578.     QUIT
  579.   This option causes PUFF to pop down out of sight.  The same effect
  580. is produced by pressing Esc.
  581.  
  582.     REMOVE PUFF FROM MEMORY
  583.   This will work only if PUFF was the last DOS extension you installed
  584. that takes over INT 16H, the Keyboard interrupt (other programs that
  585. do this include GWNOTE, PCCALC, PSRD, KQE and the BelleSoft Pop-Ups).
  586. You can cancel this option by pressing Esc.
  587.  
  588.     CUSTOMISING PUFF
  589.   The customising facilities are available from the main menu (via 'C'
  590. for Customise) or from directory of file browsing (via 'O' for
  591. Options). The customise menu offers the following choices:
  592.     Set initial view options (a submenu)
  593.     Move PUFF Menu
  594.     Change Pop-Up key
  595.     Beep Tone/Duration
  596.     Normal screen colour
  597.     Emphasised screen colour
  598.     Paste Enter key
  599.     Ignore linefeeds
  600.  
  601.     Date/time of copyfile
  602.  
  603.     Quit
  604.  
  605.     SET INITIAL VIEW OPTIONS
  606.   This sub-menu is described offers the following choices:
  607.  
  608.     Set initial drive/directory
  609.     Expand Tabs
  610.     Zoom to full screen
  611.     Directory Order
  612.     LoHex characters
  613.     Hex display encoding
  614.     Attribute or Size
  615.     Case Sensitive search
  616.     Quit
  617.  
  618.   Most of these settings determine the values of the appropriate
  619. variables when a new directory or file is entered, though all can
  620. altered while file browsing using the appropriate commands.
  621.   The first option is different however.  It corresponds to the
  622. "InitVu" option on the PUFF command, and determines which drive,
  623. directory or file PUFF displays when popped up.  A setting of
  624. "Current" makes PUFF pop up at the main menu, using the current DOS
  625. directory on the current DOS drive as a starting point.  Entering a
  626. drive letter and/or a directory here will cause PUFF to use that
  627. drive/directory as a starting point instead and PUFF will initially
  628. pop up in directory browsing (rather than the main menu). If the name
  629. resolves to a file (rather than a directory) then PUFF will initially
  630. pop up in file browsing.
  631.   The defaults for these options are:
  632.    .the current DOS drive and directory are used
  633.    .tabs are initially expanded in text mode.
  634.    .zoom mode is used.
  635.    .the initial order in which a directory is displayed is the order
  636.     given by a DOS dir command
  637.    .hex characters below X'20' (which because they are used for
  638.     printer control can disrupt a Print Screen operation) are
  639.     displayed "as-is" rather than as ".".
  640.    .HEX file encoding defaults to ASCII.
  641.    .file sizes rather than atttributes are displayed.
  642.    .searching is not case-sensitive.
  643.  
  644.     MOVE PUFF MENU
  645.   This option lets you move the pop-up PUFF menu around the screen
  646. using the left, right, up and down keys or to one of the four screen
  647. corners using the Home, PgUp, End or PgDn keys.  You can fix it in a
  648. new position by pressing  Enter.  You can cancel this option by
  649. pressing Esc.
  650.  
  651.     CHANGE POP-UP KEY
  652.   This lets you change the pop-up key by pressing the new one.  The
  653. new key can be any key with an Extended ASCII code associated with it
  654. (i.e. it includes combinations like Alt-1 and Ctrl-PgUp).  Be careful
  655. though, it's not very sensible to make it F1 or F2 or one of the
  656. cursor keys.  PUFF will not let you choose  ENTER  as a pop-up key.
  657. You can cancel this option by pressing Esc.
  658.   PUFF tries to display the name of the selected key, but the names
  659. it knows are limited to the 92 keys listed above in the section
  660. "INSTALLING PUFF".  Any other key will be displayed as "Unknown".
  661.  
  662.     BEEP TONE/DURATION
  663.   The cursor keys are used to change the nature of PUFF's beep.  Note
  664. that here the Esc key is used to reset things to the defaults, the
  665. only exit from this option is via Enter (which fixes the values).
  666.  
  667.     SCREEN COLOR
  668.   The cursor keys are used to change the screen attributes.  'Normal'
  669. means the default PUFF color, 'Emphasised' is what PUFF uses to
  670. indicate a selected option or hilight an error message.  Here again
  671. the Esc key is used to reset things to the defaults, the only exit
  672. from this option is via Enter (which fixes the values).
  673.  
  674.     PASTE ENTER KEY AND IGNORE LINEFEEDS
  675.   The first of these determines how Carriage Returns are to be
  676. treated during pasting.  PUFF lets you replace them with some other
  677. key.  This is particularly useful when pasting into an editor that
  678. requires some special key to be pressed to insert a new line into the
  679. file.  By default they are left as Carriage Returns.  PUFF tries to
  680. display the name of the selected key, but the names it knows are
  681. limited to the 92 keys which can be assigned to the hot-key and the
  682. Enter key.  Any other key will be displayed as "Unknown".
  683.   If the Enter key (or whatever it's been replaced by) does the
  684. necessary "insert new line" fucntion, linefeeds should be ignored.
  685. However, in some editors both Enter and Linefeeds should be pasted.
  686. The first creates a new line (but may move the cursor to align with
  687. the first non-blank on the line above) and the second moves the cursor
  688. back to the start of the line.
  689.  
  690.     DATE/TIME OF COPYFILE
  691.   When copying a file, PUFF let's you choose whether the date/time
  692. stamp on the new file should be the same as the old file (this is
  693. what the DOS COPY command does) or the current date and time.
  694.  
  695.     DATA ENTRY IN PUFF
  696.   PUFF allows editing of data input rather like DOSEDIT.  This
  697. facility is available when you use the "Select Directory for Browsing"
  698. option or the "SEARCH" command in the file browser.
  699. A small buffer of previously entered strings is maintained and during
  700. data entry PUFF responds to the following keys:
  701.  
  702.         Up          retrieve previous stored string
  703.         Down        retrieve next stored string
  704.         Home        move cursor to start of string
  705.         End         move cursor to end of string
  706.         Left        move cursor one column to the left
  707.         Right       move cursor one column to the right
  708.         Ins         toggle insert mode (cursor shape changes)
  709.         Del         delete character at the cursor
  710.         Backspace   delete character before the cursor
  711.         Enter       pass current string to PUFF
  712.         Esc         cancel data entry
  713.  
  714.   The "ring" of stored strings is limited to 256 bytes.  The normal
  715. cursor is a blinking underscore.  In insert mode it's a blinking solid
  716. rectangle.
  717.  
  718.     SOME DESIGN DETAILS
  719.   One of my main aims in writing PUFF was to fit it into a small
  720. amount of memory (originally 20-24K).  This has significantly affected
  721. the design in a number of places.  The purpose of this section is to
  722. outline some of the key aspects of PUFF's design, so that the
  723. interested user can understand why it does (or doesn't do) certain
  724. things in a particular way.
  725.  
  726.     USE OF STORAGE
  727.   The PUFF.COM file, which is about 23K in size, is made up of:
  728.    .Resident Code       - this occupies about 12K.
  729.    .Resident Data       - this occupies about 5K and includes
  730.                           messages, menus, tables etc.
  731.    .Initialization Code - this code, about 2K in size, is overwritten
  732.                           by PUFF's buffers when PUFF is resident.
  733.    .Initialization Data - these messages and tables occupy about 1K
  734.                           and are overwritten by PUFF's buffers.
  735.    .Help screens        - these occupy about 3K and are overwritten
  736.                           by PUFF's buffers if the /X option is used.
  737.  
  738.   When resident, PUFF needs space for:
  739.    .Screen Buffer       - this is 4K in size.  Before PUFF pops up it
  740.                           stores the existing screen in this buffer
  741.                           (2K of data and 2K of attributes).  If the
  742.                           /E option is used the buffer is enlarged to
  743.                           8K to allow 43 or even 50-line screens to
  744.                           be used.
  745.    .Directory/File Buffer - without the /b option, this is 6K in size.
  746.                           The first 2K is reserved for directory use,
  747.                           so there is no need to re-read the directory
  748.                           when leaving file browse if the directory
  749.                           has less than 93 entries.  In Directory
  750.                           Browse, PUFF uses 22 bytes for each entry,
  751.                           so the buffer will hold about 275 entries.
  752.                           Any sorting is done in place.  In File
  753.                           Browse 4K of this is split into two 2K
  754.                           buffers.  This is to avoid the excessive
  755.                           file I/O that would occur with a single
  756.                           buffer when scrolling back and forth near a
  757.                           buffer boundary.
  758.                           If the /b option is used the buffer is
  759.                           doubled to 12K, with room for 555 entries.
  760.                           The first 4K is reserved for directory use,
  761.                           so there is no need to re-read the
  762.                           directory when leaving file browse if the
  763.                           directory has less than 186 entries.  The
  764.                           file browser uses the last 8k as two 4K
  765.                           buffers which halves the number of file I/O
  766.                           operations and thus improving scrolling
  767.                           speed.
  768.    .Data Buffers        - these are used to store the current file
  769.                           and directory names, to hold the search
  770.                           string during searches, and to build lines
  771.                           to be displayed on the screen.  They occupy
  772.                           about 2K.
  773.   Thus the total resident size is made up of:
  774.        12K resident code
  775.         5K resident data
  776.         3K help screens
  777.    10K-20K screen and file buffers
  778.         2K data buffers
  779.  
  780.     PERFORMANCE
  781.   Because of its limited buffer space, certain operations take some
  782. time.  For example, PUFF may have to rebuild and re-sort the directory
  783. whenever you leave the file browser, or go  up from a sub-directory to
  784. its parent.  Similarly, when scrolling or searching through a file,
  785. PUFF has to read each 2K or 4K chunk in turn, which takes some time.
  786.  
  787.     SCREEN I/O
  788.   The low level video driver routines in PUFF, give particularly good
  789. performance on the Color Graphics Adapter.  The routine used to move
  790. the PUFF menu about the screen is rather primitive, and looks very
  791. unsightly on a Color Display.  However it is very small and since the
  792. menu is not moved very often it does not seem worth the space to
  793. improve it.
  794.  
  795.     TEXT FILE HANDLING
  796.   PUFF can be confused if attempts are made to display, in text mode,
  797. files which do not conform to its expectations:
  798.     .a CR/LF sequence at the end of each record
  799.     .a Ctrl-Z at the end of the file (and nowhere else)
  800.     .a maximum record length of 255 characters
  801.  
  802.   PUFF counts lines by looking for CR/LF sequences, and the line
  803. counter will be wrong if some other line terminator is used. Similarly
  804. PUFF displays the  End of File  message when it detects a Ctrl-Z, so
  805. files with embedded Ctrl-Z's will confuse it.
  806.  
  807.     DETERMINING RESIDENCY
  808.   PUFF tests to see if it is already resident by following the storage
  809. allocation chain. This points it to each PSP in memory and it checks
  810. the code after each PSP to see if it is a copy of itself.
  811.   The logic to do this is based on undocumented pointers in the Memory
  812. Control Blocks and PSPs, but seems reliable in DOS 2 and DOS 3.  At
  813. worst another copy will be loaded when it should not be.
  814.  
  815.     Trapping INT 16 (Keyboard Request)
  816.   PUFF takes over INT 16 and intercepts all application requests for
  817. keystrokes.  The way this is done should be totally transparent except
  818. that in text modes, no application program will ever see PUFF's hot-key
  819. (since this will cause PUFF to pop up, or if already popped up, to pop
  820. down again).
  821.   Note that in general PUFF can co-exist peacefully with other
  822. applications which intercept INT 16.
  823.  
  824.     Trapping INT 28 (DOS Idle Interrupt)
  825.   PUFF intercepts INT 28 so that it can avoid popping up when DOS is
  826. usy.  This is based on techniques described in PC Magazine for April
  827. 14th 1987 (Instant Acccess to Directories by Jeff Prosise - pages
  828. 313-334).  PUFF should be able to co-exist peacefully with other popups.
  829.   Prior to Version 2.3, PUFF hooked the INT 21H vector and was DOS
  830. version-dependent.  The new technique should be much safer.
  831.  
  832.     ERROR MESSAGES
  833.   The following is a list, in alphabetical order, of the messages
  834. that PUFF displays:
  835.    - Can't go any deeper - press any key. - This message appears if
  836.      you try to go deeper than eight levels into the directory tree.
  837.      In fact, due to the limited width of PUFF's window you may not
  838.      be able to see the full directory name before you get this deep
  839.     (though PUFF does in fact maintain it internally).
  840.    - Error copying file - press any key. - This message is displayed
  841.      if PUFF detects an error when trying to copy a file.  Possible
  842.      reasons include a write-protected disk or an attempt to copy a
  843.      file to a non-existent directory.
  844.    - Error erasing file - press any key. - This message is displayed
  845.      if PUFF detects an error when trying to erase a file.  Possible
  846.      reasons include a write-protected disk or an attempt to erase
  847.      a read-only file or a directory.
  848.    - Error in Hex string - Press any key. This message is displayed
  849.      if a HEX search string contains an odd number of digits or a
  850.      character other than a valid hex digit or blank.
  851.    - Error reading file - Press any key. This message is displayed
  852.      if PUFF detects an error when reading a file.
  853.    - Error renaming file - press any key. This message is displayed
  854.      if PUFF detects an error when trying to rename a file. Possible
  855.      reasons include a write-protected disk or an attempt to move a
  856.      file to a non-existent directory.
  857.    - Error writing Profile - Some sort of error occurred while PUFF
  858.      was trying to create PUFF.PRO, such as a write-protected diskette.
  859.    - File is empty - press any key. - This message is displayed if
  860.      you try to browse or paste a zero-length file.
  861.    - No file(s) found - press any key. - This message is displayed
  862.      if you try to browse an empty disk or directory or switch to
  863.      browing a non-existent file
  864.    - No search to repeat - press any key. - This message is displayed
  865.      if the Repeat command is issued without there being a preceding
  866.      search.
  867.    - Not a file - press any key. - This message is displayed if you
  868.      try to paste the contents of a directory.
  869.    - Search interrupted - press any key. - This message is displayed
  870.      if searching is terminated by the user pressing a key.
  871.    - String not found - press any key. - This message is displayed
  872.      if a search is unsuccessful.
  873.    - Too many files - press any key. - This message is displayed if
  874.      there are more files in the selected directory than PUFF's
  875.      buffer can hold (275 or 555 if the /b option is used).
  876.    - Unsafe to remove PUFF - This message is displayed if an attempt
  877.      is made to remove PUFF when another resident program has taken
  878.      over INT 16 or INT 28 since PUFF was installed.
  879.  
  880.   The following messages can appear during PUFF initialisation:
  881.    - Bad or missing PUFF profile - Either the PUFF.PRO file could not
  882.      be found in the current or root directories or it did not contain
  883.      the necessary fields (in particular the string  PUFF3  at the start).
  884.      If no PUFF.PRO can be found, PUFF uses default values.
  885.    - Invalid option - the PUFF command was followed by a / which was
  886.      not followed by a valid option (B, E, H, L, N, Q, R, S and X are the
  887.      valid options).
  888.    - No resident version to remove - PUFF was invoked with the /R option
  889.      and no resident version could be found.
  890.    - PUFF does not support this version of DOS - PUFF will not run under
  891.      DOS 1.  PUFF should now run under all later versions of DOS,
  892.      including the OS/2 Compatability Box.
  893.    - PUFF is already installed - An attempt was made to install PUFF
  894.      when PUFF was already resident.
  895.    - Resident version cannot be removed - PUFF was invoked with the /R
  896.      option but another DOS extension prevented the resident version
  897.      from being removed.
  898.    - Resident version removed - PUFF was invoked with the /R option
  899.      and a resident version has been successfully removed
  900.    - Warning - PUFF profile needs updating - PUFF was run with an out
  901.      of date profile, so some new options will be set to their default
  902.      values.  Writing out the profile will allow these new options to
  903.      be set as you would like.
  904.  
  905.     FORMAT OF PUFF.PRO
  906.   The profile is a small file, 107 bytes long, containing the
  907. following fields:
  908.  
  909.  Content           Offset  Length   Default Value (in Hex)
  910.  
  911.  marker               0       5     5055464633 ('PUFF3')
  912.  hot-key scancode     5       2     0020 (Alt-D)
  913.  normal mono attrib   7       1     20 (normal)
  914.  hilite mono   "      8       1     70 (reverse video)
  915.  normal color  "      9       1     1e (yellow on blue)
  916.  hilite color  "      a       1     78 (black on grey)
  917.  beep tone            b       2     4B
  918.  beep duration        d       2     4B
  919.  top box line         f       1     1
  920.  left col (80 cols)  10       1     28 (decimal 40)
  921.  quiet install       11       1     0 ()= No, 1= Yes)
  922.  ega allowed         12       1     0 (0= No, 1= Yes)
  923.  help included       13       1     0 (0= Yes,1= No)
  924.  buffer size         14       1     0 (0= 6K, 1=12K)
  925.  zoom files?         15       1     1 (1=no,  0= yes)
  926.  expand tabs?        16       1     0 (0= no, 1= yes)
  927.  directory order     17       1     0 (0=DIR, 1=size, 2=date
  928.                                       (3=name, 4=extension)
  929.  ASCII/EBCDIC        18       1     0 (0= ASCII, 1= EBCDIC)
  930.  low hex switch      19       1     0 (0= display, 1= suppress)
  931.  attr/size           1a       1     0 (0= size, 1= attributes)
  932.  case sensitivity    1b       1     0 (0= insensitive, 1= sensitive)
  933.  paste CR key        1c       2     0D1C (Carriage Return)
  934.  linefeed            1e       1     0 (0= ignore, 1=paste)
  935.  initial view        1f      72     0 (0 = use current)
  936.                                       (else drive/path/filespec)
  937.  
  938.  Date format         68       1     0 (-1 means ask DOS, 0 = mmddyy)
  939.                                       (1 = ddmmyy, 2 = yymmdd)
  940.  Time format         69       1     0 (-1 means ask DOS, 0= 12h, 1= 24hr)
  941.  Date/Time of copy   6a       1     0 (0= current time, 1= original time)
  942.  
  943.   Note that this profile is incompatible with that used by earlier
  944. versions of PUFF.
  945.   The profile is loaded into PUFF.COM at offset 3 from the start
  946. of the program, overlaying the default values contained there.
  947.  
  948.     THINGS TO AVOID
  949.   The architecture of PC/DOS does not allow programs like PUFF to be
  950. legal, decent and honest.  There is no official way in which a resident
  951. program can get control, even at the DOS prompt, and issue DOS calls.
  952. In writing PUFF I've had to make use of a number of dirty tricks and
  953. to use undocumented interfaces.  Even so PUFF is safe most of the time.
  954. Here are a few things which can cause problems:
  955.  
  956.    Displaying COM files and other arbitrary files in ASCII mode
  957. (the main symptom will be peculiar behaviour of PUFF's line counting)
  958.    Pasting keystrokes from a non-ASCII file (anything could happen
  959. here since PUFF will return absurd and impossible values as keystrokes).
  960.    Popping up PUFF when DOS has issued a critical error message
  961. (e.g. Abort, Retry or Ignore ).
  962.  
  963.